package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbItemCatMapper;
import com.dongdongshop.pojo.TbItemCat;
import com.dongdongshop.service.ItemcatService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@DubboService
public class ItemcatServiceImpl implements ItemcatService {

    @Resource
    private TbItemCatMapper itemCatMapper;

    @Override
    public List<TbItemCat> itemcatList() {
        List<TbItemCat> list = itemCatMapper.selectByCountPid();
        return list;
    }

    @Override
    public List<TbItemCat> querysubordinate(Long id) {
        List<TbItemCat> list = itemCatMapper.querysubordinate(id);
        return list;
    }

    @Override
    public List<TbItemCat> getdaoh(Long id) {
        List<TbItemCat> list = itemCatMapper.getdaoh(id);
        return list;
    }

    @Override
    public TbItemCat selectById(Long id) {
        return itemCatMapper.selectByPrimaryKey(id);
    }

    @Override
    public void updateInfo(TbItemCat tbItemCat) {
        itemCatMapper.updateByPrimaryKeySelective(tbItemCat);
    }

    @Override
    public void insertInfo(TbItemCat tbItemCat) {
        itemCatMapper.insertSelective(tbItemCat);
    }

    @Override
    public void deletedd(Long id) {
        itemCatMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<TbItemCat> itemcatList1(Long parentId) {
        List<TbItemCat> list = itemCatMapper.selectByCountPid1(parentId);
        return list;
    }

    @Override
    public List<TbItemCat> selectInfo() {
        return itemCatMapper.selectByExample(null);
    }

    @Override
    public TbItemCat selectByItemCat(Long goodsId) {
        return itemCatMapper.selectByPrimaryKey(goodsId);
    }

    //    @Override
//    public List<TbItemCat> itemcatParentId(long parentId) {
//        List<TbItemCat> list = itemCatMapper.itemcatParentId(parentId);
//        return list;
//    }
}
